// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
import 'core-js/stable'
import 'regenerator-runtime/runtime'

import LuckDraw from '@/components/vue-luck-draw'
Vue.use(LuckDraw)
import 'amfe-flexible'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import JsBarcode from 'jsbarcode'
Vue.prototype.jsbarcode = JsBarcode

import AMapLoader from '@amap/amap-jsapi-loader';

window._AMapSecurityConfig = {
    securityJsCode: '1809a0fa753b902fc5c75811ddab973a' // 开发环境使用
}
AMapLoader.load({
    key: "1809a0fa753b902fc5c75811ddab973a",              // 申请好的Web端开发者Key，首次调用 load 时必填
    version: "2.0",   // 指定要加载的 JSAPI 的版本，缺省时默认为 1.4.15
    plugins: [],           // 需要使用的的插件列表，如比例尺'AMap.Scale'等
    AMapUI: {
        // 是否加载 AMapUI，缺省不加载
        version: '1.1', // AMapUI 缺省 1.1
        plugins: [] // 需要加载的 AMapUI ui插件
    },
    Loca: {
        // 是否加载 Loca， 缺省不加载
        version: '2.0.0' // Loca 版本，缺省 1.3.2
    }
}).then((AMap) => {
    // 挂载AMap
    Vue.prototype.$AMap = AMap;
});

import {
	getFinalOpration
} from './api/home.js'
// 封装缓存的方法
import {
	setStore,
	getStore,
	removeStore
} from './utils/storage'
Vue.prototype.$setStore = setStore
Vue.prototype.$getStore = getStore
Vue.prototype.$removeStore = removeStore

// 设置 js中可以访问 $cdn
import {
	$cdn
} from '@/config'
Vue.prototype.$cdn = $cdn

import $http from '@/utils/request'
Vue.prototype.$http = $http

import wxconfig from '@/utils/wxconfig.js';
Vue.prototype.wxconfig=wxconfig;
Vue.config.ignoredElements = ['wx-open-launch-weapp']

//日期
import {formatDate} from './utils/validate'
Vue.prototype.$formatDate=formatDate;
import {formatGetDate} from './utils/validate'
Vue.prototype.$formatGetDate=formatGetDate;
import {formatDateDays} from './utils/validate'
Vue.prototype.$formatDateDays=formatDateDays;
import {formatDateSplicing} from './utils/validate'
Vue.prototype.$formatDateSplicing=formatDateSplicing;

// 复制到剪贴板
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)

// 全局引入按需引入UI库 vant
import '@/plugins/vant'
// 引入全局样式
import '@/assets/css/index.scss'
import {
	Form
} from 'vant';

Vue.use(Form);
// 移动端适配
import 'lib-flexible/flexible.js'

import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/css/swiper.css'
Vue.use(VueAwesomeSwiper, /* { default options with global component } */ )
// filters
import './filters'
import VueCookies from 'vue-cookies'
Vue.config.productionTip = false
Vue.use(VueCookies)
import { VueJsonp } from 'vue-jsonp'
Vue.prototype.$jsonp=formatDate;
Vue.use(VueJsonp)
new Vue({
	el: '#app',
	router,
	store,
	render: h => h(App)
})


const token = getStore('token')
const pageJudge = getStore('judge')
const hashTsxt = (window.location.hash).split('/')
